Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fs-exists-sync

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-exists-sync

Drop-in replacement for `fs.existsSync` with zero dependencies. Other libs I found either have crucial differences from fs.existsSync, or unnecessary dependencies. See README.md for more info.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2M
decreased by-9.27%
Maintainers
1
Weekly downloads
 
Created

What is fs-exists-sync?

The fs-exists-sync npm package provides a simple and synchronous way to check if a file or directory exists in the filesystem. It is a lightweight utility that wraps around the Node.js fs module's synchronous methods to offer a straightforward API for existence checks.

What are fs-exists-sync's main functionalities?

Check if a file exists

This feature allows you to check if a specific file exists at the given path. The function returns a boolean value indicating the existence of the file.

const exists = require('fs-exists-sync');
const fileExists = exists('path/to/file.txt');
console.log(fileExists); // true or false

Check if a directory exists

This feature allows you to check if a specific directory exists at the given path. The function returns a boolean value indicating the existence of the directory.

const exists = require('fs-exists-sync');
const dirExists = exists('path/to/directory');
console.log(dirExists); // true or false

Other packages similar to fs-exists-sync

Keywords

FAQs

Package last updated on 09 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc